\hypertarget{class_caziac_1_1_http_1_1_a_handle_request}{
\section{Caziac::Http::AHandleRequest Class Reference}
\label{class_caziac_1_1_http_1_1_a_handle_request}\index{Caziac::Http::AHandleRequest@{Caziac::Http::AHandleRequest}}
}


Handle for a Request.  


{\ttfamily \#include $<$AHandleRequest.hh$>$}\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_caziac_1_1_http_1_1_a_handle_request_a4f668de331d102d610ca286c5a1bd667}{AHandleRequest} (\hyperlink{class_caziac_1_1_tools_1_1_i_reader}{Tools::IReader} $\ast$reader)
\begin{DoxyCompactList}\small\item\em constructor of the \hyperlink{class_caziac_1_1_http_1_1_handle_request}{HandleRequest} \item\end{DoxyCompactList}\item 
\hypertarget{class_caziac_1_1_http_1_1_a_handle_request_ad1c8bba965d79067a0ac01645a67c052}{
virtual \hyperlink{class_caziac_1_1_http_1_1_a_handle_request_ad1c8bba965d79067a0ac01645a67c052}{$\sim$AHandleRequest} ()}
\label{class_caziac_1_1_http_1_1_a_handle_request_ad1c8bba965d79067a0ac01645a67c052}

\begin{DoxyCompactList}\small\item\em destructor of the \hyperlink{class_caziac_1_1_http_1_1_handle_request}{HandleRequest} \item\end{DoxyCompactList}\item 
std::multimap$<$ std::string, std::string $>$ const \& \hyperlink{class_caziac_1_1_http_1_1_a_handle_request_ad0ea9eef963ee41060863dbedb4be6a7}{getHeader} () const 
\begin{DoxyCompactList}\small\item\em this function get the header of the Request \item\end{DoxyCompactList}\item 
\hyperlink{struct_caziac_1_1_http_1_1_line_request}{LineRequest} const \& \hyperlink{class_caziac_1_1_http_1_1_a_handle_request_a465862de848ff725b778879cd3ea3dd9}{getLineRequest} () const 
\begin{DoxyCompactList}\small\item\em this function get the \hyperlink{struct_caziac_1_1_http_1_1_line_request}{LineRequest} (method url version) \item\end{DoxyCompactList}\item 
\hyperlink{class_caziac_1_1_tools_1_1_i_reader}{Tools::IReader} $\ast$ \hyperlink{class_caziac_1_1_http_1_1_a_handle_request_aaf6f9b21d65ad64afaa13becb2d71119}{getReader} ()
\begin{DoxyCompactList}\small\item\em this function get the Reader which read the stream \item\end{DoxyCompactList}\item 
void \hyperlink{class_caziac_1_1_http_1_1_a_handle_request_a832f248171cb4006812dcfa734dca8ba}{readRequestHeader} ()
\begin{DoxyCompactList}\small\item\em use the reader until it will find an empty string \item\end{DoxyCompactList}\item 
virtual void \hyperlink{class_caziac_1_1_http_1_1_a_handle_request_a0da91eb580ae47dc36ec1de4af02851e}{consumeHeaderLine} (std::string const \&line)=0
\begin{DoxyCompactList}\small\item\em \mbox{[}User Implementation\mbox{]} \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_caziac_1_1_http_1_1_a_handle_request_a10dc01084c7f87ff535bbbbd8a1a58a8}{
void \hyperlink{class_caziac_1_1_http_1_1_a_handle_request_a10dc01084c7f87ff535bbbbd8a1a58a8}{addDescription} (std::string const \&key, std::string const \&def)}
\label{class_caziac_1_1_http_1_1_a_handle_request_a10dc01084c7f87ff535bbbbd8a1a58a8}

\begin{DoxyCompactList}\small\item\em add a description to the Header \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Handle for a Request. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_caziac_1_1_http_1_1_a_handle_request_a4f668de331d102d610ca286c5a1bd667}{
\index{Caziac::Http::AHandleRequest@{Caziac::Http::AHandleRequest}!AHandleRequest@{AHandleRequest}}
\index{AHandleRequest@{AHandleRequest}!Caziac::Http::AHandleRequest@{Caziac::Http::AHandleRequest}}
\subsubsection[{AHandleRequest}]{\setlength{\rightskip}{0pt plus 5cm}Caziac::Http::AHandleRequest::AHandleRequest ({\bf Tools::IReader} $\ast$ {\em reader})}}
\label{class_caziac_1_1_http_1_1_a_handle_request_a4f668de331d102d610ca286c5a1bd667}


constructor of the \hyperlink{class_caziac_1_1_http_1_1_handle_request}{HandleRequest} 
\begin{DoxyParams}{Parameters}
\item[{\em reader}]the Socket reader This will set attribue \char`\"{}\_\-reader\char`\"{} for later using \end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{class_caziac_1_1_http_1_1_a_handle_request_a0da91eb580ae47dc36ec1de4af02851e}{
\index{Caziac::Http::AHandleRequest@{Caziac::Http::AHandleRequest}!consumeHeaderLine@{consumeHeaderLine}}
\index{consumeHeaderLine@{consumeHeaderLine}!Caziac::Http::AHandleRequest@{Caziac::Http::AHandleRequest}}
\subsubsection[{consumeHeaderLine}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Caziac::Http::AHandleRequest::consumeHeaderLine (std::string const \& {\em line})\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{class_caziac_1_1_http_1_1_a_handle_request_a0da91eb580ae47dc36ec1de4af02851e}


\mbox{[}User Implementation\mbox{]} 
\begin{DoxyParams}{Parameters}
\item[{\em a}]line header like \char`\"{}Content-\/length : 78\char`\"{} This function parse a line and add a definition to the header with the addDescription function. The header is a multimap so when you call three times addDescription with the sames key but different definition this will save all the 3 values. \end{DoxyParams}
\hypertarget{class_caziac_1_1_http_1_1_a_handle_request_ad0ea9eef963ee41060863dbedb4be6a7}{
\index{Caziac::Http::AHandleRequest@{Caziac::Http::AHandleRequest}!getHeader@{getHeader}}
\index{getHeader@{getHeader}!Caziac::Http::AHandleRequest@{Caziac::Http::AHandleRequest}}
\subsubsection[{getHeader}]{\setlength{\rightskip}{0pt plus 5cm}std::multimap$<$std::string, std::string$>$ const\& Caziac::Http::AHandleRequest::getHeader () const}}
\label{class_caziac_1_1_http_1_1_a_handle_request_ad0ea9eef963ee41060863dbedb4be6a7}


this function get the header of the Request \begin{DoxyReturn}{Returns}
the header
\end{DoxyReturn}
This function return the header parsed by the user with the consumeHeaderLine method. This member function is for consulting. \hypertarget{class_caziac_1_1_http_1_1_a_handle_request_a465862de848ff725b778879cd3ea3dd9}{
\index{Caziac::Http::AHandleRequest@{Caziac::Http::AHandleRequest}!getLineRequest@{getLineRequest}}
\index{getLineRequest@{getLineRequest}!Caziac::Http::AHandleRequest@{Caziac::Http::AHandleRequest}}
\subsubsection[{getLineRequest}]{\setlength{\rightskip}{0pt plus 5cm}{\bf LineRequest} const\& Caziac::Http::AHandleRequest::getLineRequest () const}}
\label{class_caziac_1_1_http_1_1_a_handle_request_a465862de848ff725b778879cd3ea3dd9}


this function get the \hyperlink{struct_caziac_1_1_http_1_1_line_request}{LineRequest} (method url version) \begin{DoxyReturn}{Returns}
the line request 
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
call readRequestHeader before to set the \hyperlink{struct_caziac_1_1_http_1_1_line_request}{LineRequest} attributes
\end{DoxyWarning}
This member function is only for consulting values. \hypertarget{class_caziac_1_1_http_1_1_a_handle_request_aaf6f9b21d65ad64afaa13becb2d71119}{
\index{Caziac::Http::AHandleRequest@{Caziac::Http::AHandleRequest}!getReader@{getReader}}
\index{getReader@{getReader}!Caziac::Http::AHandleRequest@{Caziac::Http::AHandleRequest}}
\subsubsection[{getReader}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Tools::IReader}$\ast$ Caziac::Http::AHandleRequest::getReader ()}}
\label{class_caziac_1_1_http_1_1_a_handle_request_aaf6f9b21d65ad64afaa13becb2d71119}


this function get the Reader which read the stream \begin{DoxyReturn}{Returns}
the reader 
\end{DoxyReturn}
\hypertarget{class_caziac_1_1_http_1_1_a_handle_request_a832f248171cb4006812dcfa734dca8ba}{
\index{Caziac::Http::AHandleRequest@{Caziac::Http::AHandleRequest}!readRequestHeader@{readRequestHeader}}
\index{readRequestHeader@{readRequestHeader}!Caziac::Http::AHandleRequest@{Caziac::Http::AHandleRequest}}
\subsubsection[{readRequestHeader}]{\setlength{\rightskip}{0pt plus 5cm}void Caziac::Http::AHandleRequest::readRequestHeader ()}}
\label{class_caziac_1_1_http_1_1_a_handle_request_a832f248171cb4006812dcfa734dca8ba}


use the reader until it will find an empty string This function consume the reader like this:


\begin{DoxyItemize}
\item read the first three world to fill the 3 \hyperlink{struct_caziac_1_1_http_1_1_line_request}{LineRequest} fields: method url version
\item call consumeHeaderLine with the line until the line returned by the reader is empty 
\end{DoxyItemize}

The documentation for this class was generated from the following file:\begin{DoxyCompactItemize}
\item 
\hyperlink{_a_handle_request_8hh}{AHandleRequest.hh}\end{DoxyCompactItemize}
